home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.2 for Intel / NeXTSTEP 3.2 for Intel.iso / NextCD / CDIS / MiniSystem.gnutar.z / MiniSystem.gnutar / usr / lib / NextStep / windowPackage.ps < prev    next >
Encoding:
Text File  |  1993-08-19  |  34.9 KB  |  1,961 lines

  1. currentshared true setshared
  2. nextdict begin
  3. /_NXDebug false def
  4. /packageSize 140 def
  5. /WindowDictSize 14 def
  6. /windowPackage1.0 //packageSize dict def
  7. /windowPackage windowPackage1.0 def
  8. /Winredraw 0 def
  9. /AppAct 1 def
  10. /AppDeact 2 def
  11. /Winresized 3 def
  12. /Winmoved 4 def
  13. /AppUnhide 7 def
  14. /AppActDeferred 9 def
  15. /AppHide 10 def
  16. /Windragged 0 def
  17. /Cursorrect 17 def
  18. /Cursorrectmask 1 Cursorrect bitshift def
  19. /Journalevent 18 def
  20. /Journaleventmask 1 Journalevent bitshift def
  21. /Journalflag 31 def
  22. /Journalflagmask 1 Journalflag bitshift def
  23. /keyMask //Keydownmask //Keyupmask or def
  24. /MouseEvent //Lmousedownmask //Lmouseupmask or
  25. //Lmousedraggedmask or
  26. //Rmousedownmask or
  27. //Rmouseupmask or
  28. //Rmousedraggedmask or
  29. //Mousemovedmask or def
  30. /MenuEvent //Rmousedownmask //Rmouseupmask or
  31. //Rmousedraggedmask or def
  32. /defaultClientMask //Lmousedownmask //Lmouseupmask or
  33. //Keydownmask or
  34. //Keyupmask or
  35. //Kitdefinedmask or
  36. //Sysdefinedmask or
  37. //Appdefinedmask or def
  38. /Helpmask 1 22 bitshift def
  39. /buckyBitMask //Commandmask //Shiftmask or
  40. //Controlmask or //Helpmask or
  41. //Alternatemask or def
  42. /contextArraySize 3 def
  43. /CDPid 0 def
  44. /CDToken 1 def
  45. /CDKitVersion 2 def
  46. /mainMenuLevel 20 def
  47. /subMenuLevel 10 def
  48. /dockLevel 5 def
  49. /normalLevel 0 def
  50. /wbutSize 15 def
  51. /_NXCurrentEventFlags 0 def
  52. /_NXCheckAndDef {
  53. 2 index 2 index known
  54. {
  55. pop pop pop
  56. } {
  57. put
  58. } ifelse
  59. } bind executeonly def
  60. /winexec {
  61. windowPackage1.0 exch get exec
  62. } bind executeonly def
  63. /pkget {
  64. windowPackage1.0 exch get
  65. } bind executeonly def
  66. /pkput {
  67. windowPackage1.0 3 1 roll put
  68. } bind executeonly def
  69. /sharedIcons {
  70. nextdict /_NXSharedGray known {_NXSharedGray} {workspaceWindow} ifelse
  71. } executeonly def
  72. /sharedCursors {
  73. nextdict /_NXSharedGrayAlpha known {_NXSharedGrayAlpha} {workspaceWindow} ifelse
  74. } executeonly def
  75. _NXDebug {
  76. /_NXStartProc {
  77. userdict /_NXCallStack known not {
  78. userdict /_NXCallStack 100 array put
  79. userdict /_NXCallStackTop 0 put
  80. } if
  81. _NXCallStack exch _NXCallStackTop exch put
  82. /_NXCallStackTop _NXCallStackTop 1 add store
  83. } def
  84. /_NXEndProc {
  85. _NXCallStackTop 0 gt {
  86. /_NXCallStackTop _NXCallStackTop 1 sub store
  87. } if
  88. } def
  89. /_NXDefProc {
  90. dup length 3 add array cvx
  91. dup 2
  92. 4 -1 roll
  93. putinterval
  94. dup 0 3 index put
  95. dup 1 /_NXStartProc cvx put
  96. dup dup length 1 sub /_NXEndProc cvx put
  97. bind def
  98. } bind executeonly def
  99. /_NXSimpleDefProc {
  100. dup length 3 add array cvx
  101. dup 2
  102. 4 -1 roll
  103. putinterval
  104. dup 0 3 index put
  105. dup 1 /_NXStartProc cvx put
  106. dup dup length 1 sub /_NXEndProc cvx put
  107. def
  108. } bind executeonly def
  109. }{
  110. /_NXDefProc {
  111. bind executeonly def
  112. } bind executeonly def
  113. /_NXSimpleDefProc {
  114. executeonly def
  115. } bind executeonly def
  116. } ifelse
  117. end
  118. nextdict /activeApp 0 _NXCheckAndDef
  119. nextdict /appLock lock _NXCheckAndDef
  120. nextdict /curActivation 0 _NXCheckAndDef
  121. nextdict /debugging false _NXCheckAndDef
  122. nextdict /_journalRecording false _NXCheckAndDef
  123. nextdict /_jrnMDownEvtNum 0 _NXCheckAndDef
  124. windowPackage1.0 /contextDataLock lock _NXCheckAndDef
  125. nextdict /_NXSnapIconsToGrid false _NXCheckAndDef
  126. windowPackage1.0 /lastCompletedActivation 0 _NXCheckAndDef
  127. windowPackage1.0 begin
  128. /version 2 def
  129. /stackSwap {
  130. 1 add exch 1 index 2 add
  131. 1 roll
  132. -1 roll
  133. } bind executeonly def
  134. /revForall {
  135. exch aload length
  136. dup 2 add -1 roll
  137. repeat
  138. } bind executeonly def
  139. end
  140. setshared
  141. currentshared true setshared
  142. windowPackage1.0 begin
  143. /_hideMenus {
  144. true exch /getWindows winexec {
  145. mark exch
  146. dup currentwindowdict
  147. dup null ne {
  148. /hideOnDeact get {
  149. {
  150. Out exch 0 exch orderwindow
  151. } stopped
  152. } if
  153. } if
  154. cleartomark
  155. } forall
  156. /returnWindows winexec
  157. } _NXDefProc
  158. /_showMenus {
  159. false exch /getWindows winexec {
  160. mark exch
  161. dup currentwindowdict
  162. dup null ne {
  163. dup /hideOnDeact get exch
  164. /kitVisible get and {
  165. {
  166. dup currentwindowlevel 0 ne
  167. 4 index 0 eq or {
  168. Above exch 0 exch orderwindow
  169. }{
  170. Below exch
  171. 4 index exch
  172. orderwindow
  173. } ifelse
  174. } stopped
  175. } if
  176. } if
  177. cleartomark
  178. } forall
  179. /returnWindows winexec pop
  180. } _NXDefProc
  181. /_lockedDoDeactivate {
  182. activeApp 0 eq not {
  183. activeApp //_hideMenus exec
  184. //Kitdefined 0 0 0 0 0 //AppDeact curActivation 0
  185. activeApp false /postByContext winexec
  186. nextdict /activeApp 0 put
  187. 0 setactiveapp
  188. } if
  189. } _NXDefProc
  190. /_lockedDoActivate {
  191. 2 copy exch //_showMenus exec
  192. dup 0 ne {
  193. currentwindowdict dup null ne {
  194. /localNum get
  195. }{
  196. pop 0
  197. } ifelse
  198. } if
  199. 1 index setactiveapp
  200. //Kitdefined 0 0
  201. 6 -1 roll 0 0
  202. //AppAct
  203. curActivation 1 add
  204. dup nextdict /curActivation 3 -1 roll put
  205. dup /lastCompletedActivation exch pkput
  206. 9 -1 roll
  207. 9 index false /postByContext winexec
  208. nextdict /activeApp
  209. 3 -1 roll
  210. put
  211. } _NXDefProc
  212. /doShellActivate {
  213. appLock {
  214. 0 3 1 roll /_lockedDoActivate winexec
  215. } monitor
  216. } _NXDefProc
  217. /doShellDeactivate {
  218. appLock {
  219. /_lockedDoDeactivate winexec
  220. dup setactiveapp
  221. nextdict /activeApp 3 -1 roll put
  222. } monitor
  223. } _NXDefProc
  224. /activateByWindow {
  225. appLock {
  226. {
  227. //_lockedDoDeactivate exec
  228. 0 exch dup currentowner exch
  229. //_lockedDoActivate exec
  230. } stopped
  231. {handleerror} if
  232. } monitor
  233. } _NXDefProc
  234. /_lockedActivateContext {
  235. dup activeApp ne {
  236. {
  237. //_lockedDoDeactivate exec
  238. 0 //_lockedDoActivate exec
  239. } stopped
  240. {handleerror} if
  241. }{
  242. pop pop
  243. } ifelse
  244. } _NXDefProc
  245. /activateContext {
  246. appLock {
  247. 0 exch //_lockedActivateContext exec
  248. } monitor
  249. } _NXDefProc
  250. /pseudoActivateWindow {
  251. mark
  252. appLock {
  253. 2 index 0 eq
  254. 3 index /lastCompletedActivation pkget gt or {
  255. {
  256. 1 index currentowner dup activeApp ne {
  257. {
  258. //_lockedDoDeactivate exec
  259. dup 3 index exch
  260. //_showMenus exec
  261. dup setactiveapp
  262. nextdict /activeApp
  263. 3 -1 roll put
  264. /lastCompletedActivation
  265. 3 index pkput
  266. true
  267. } stopped {
  268. handleerror stop
  269. } if
  270. }{
  271. true
  272. } ifelse
  273. } stopped {
  274. false
  275. } if
  276. }{
  277. false
  278. } ifelse
  279. {
  280. cleartomark pop pop
  281. }{
  282. cleartomark
  283. //Kitdefined 0 0 0 0 0 //AppDeact
  284. 9 -1 roll 0
  285. 10 -1 roll currentowner false
  286. /postByContext winexec
  287. } ifelse
  288. } monitor
  289. } _NXDefProc
  290. /sendDeferredAct {
  291. appLock {
  292. //Kitdefined 0 0 0 0 0
  293. //AppActDeferred
  294. curActivation 1 add
  295. nextdict /curActivation 2 index put 0
  296. 10 -1 roll false /postByContext winexec
  297. curActivation
  298. } monitor
  299. } _NXDefProc
  300. /activateSelf {
  301. appLock {
  302. 0 ne
  303. activeApp 0 eq or {
  304. 0 currentcontext //_lockedActivateContext exec
  305. } if
  306. } monitor
  307. } _NXDefProc
  308. /deactivateCurrContext {
  309. appLock {
  310. //_lockedDoDeactivate exec
  311. /setArrowCursor winexec
  312. } monitor
  313. } _NXDefProc
  314. /deactivateSelf {
  315. appLock {
  316. activeApp currentcontext eq {
  317. //_lockedDoDeactivate exec
  318. /setArrowCursor winexec
  319. } if
  320. } monitor
  321. } _NXDefProc
  322. /activateNextApp {
  323. appLock {
  324. dup activeApp eq activeApp 0 eq or {
  325. true 0 /getWindows winexec
  326. false exch {
  327. dup currentwindowlevel
  328. dup //mainMenuLevel gt exch
  329. dup //dockLevel lt exch
  330. //normalLevel ge and or {
  331. dup currentwindowdict
  332. dup null ne {
  333. dup /icon get 1 ne
  334. exch /hideOnDeact get not
  335. and {
  336. dup currentowner
  337. 4 index ne {
  338. true exit
  339. } if
  340. } if
  341. }{
  342. pop
  343. } ifelse
  344. } if
  345. pop
  346. } forall
  347. {
  348. 4 index exch currentowner //_lockedActivateContext exec
  349. pop
  350. }{
  351. 1 index activeApp eq {
  352. //_lockedDoDeactivate exec
  353. } if
  354. } ifelse
  355. /returnWindows winexec
  356. } if
  357. pop pop
  358. } monitor
  359. } _NXDefProc
  360. /orderPanelIfActive {
  361. appLock {
  362. activeApp currentcontext eq {
  363. 3 copy orderwindow
  364. } if
  365. currentwindowdict /kitVisible
  366. 4 2 roll pop
  367. Out ne put
  368. } monitor
  369. } _NXDefProc
  370. /orderWinsAndPanels {
  371. appLock {
  372. dup currentwindowdict
  373. dup /hideOnDeact get not
  374. exch /kitVisible get
  375. 2 index currentowner activeApp eq
  376. and or {
  377. orderwindow
  378. }{
  379. pop pop pop
  380. } ifelse
  381. } monitor
  382. } _NXDefProc
  383. /setHideOnDeact {
  384. mark 4 1 roll
  385. appLock {
  386. dup currentwindowdict
  387. dup /hideOnDeact get
  388. 3 index ne {
  389. dup /hideOnDeact 4 index put
  390. 3 -1 roll {
  391. /kitVisible 4 -1 roll put
  392. activeApp currentcontext ne {
  393. Out exch 0 exch orderwindow
  394. } if
  395. } if
  396. } if
  397. } monitor
  398. cleartomark
  399. } _NXDefProc
  400. /reorderWindows {
  401. appLock {
  402. dup activeApp eq exch
  403. true exch /getWindows winexec
  404. 0 exch {
  405. dup currentwindowlevel 0 eq
  406. 1 index currentwindowdict
  407. /hideOnDeact get not
  408. 5 index or and {
  409. exch dup 0 eq {
  410. Above
  411. }{
  412. Below
  413. } ifelse
  414. exch 2 index orderwindow
  415. }{
  416. pop
  417. } ifelse
  418. } forall
  419. pop /returnWindows winexec pop
  420. } monitor
  421. } _NXDefProc
  422. /hideOtherApps {
  423. dup 0 ne {
  424. dup /activateContext winexec
  425. } if
  426. true 0 /getWindows winexec {
  427. mark exch
  428. dup currentowner
  429. dup 0 ne
  430. 1 index 6 index ne and {
  431. dup //CDToken /currentContextData winexec
  432. 3 -1 roll ne {
  433. //Kitdefined 0 0 0 0 0
  434. //AppHide 0 0
  435. 10 -1 roll false
  436. /postByContext winexec
  437. } if
  438. } if
  439. cleartomark
  440. } forall
  441. /returnWindows winexec pop
  442. } _NXDefProc
  443. end
  444. setshared
  445. currentshared true setshared
  446. nextdict /Beepfile (SystemBeep) _NXCheckAndDef
  447. nextdict /Beepwindow 0 _NXCheckAndDef
  448. nextdict /_beepContext null _NXCheckAndDef
  449. nextdict /_beepCondition condition _NXCheckAndDef
  450. nextdict /_beepLock lock _NXCheckAndDef
  451. nextdict /_mustBeep false _NXCheckAndDef
  452. windowPackage1.0 begin
  453. /_doBeep {
  454. mark
  455. {
  456. Beepfile null eq
  457. {
  458. Beepwindow 0 ne
  459. {
  460. gsave
  461. true setinstance
  462. Beepwindow windowdeviceround
  463. Beepwindow currentwindowbounds
  464. 4 -2 roll pop pop 0 0 4 2 roll
  465. 1 setgray .333 setalpha
  466. Sover compositerect
  467. 500 {yield} repeat
  468. newinstance
  469. grestore
  470. } if
  471. }{
  472. Beepfile 0 playsound
  473. } ifelse
  474. } stopped
  475. cleartomark
  476. } bind executeonly def
  477. /_waitToBeep {
  478. _beepLock
  479. {
  480. {
  481. _mustBeep
  482. {
  483. exit
  484. } if
  485. yield
  486. _beepLock _beepCondition wait
  487. } loop
  488. } monitor
  489. } bind executeonly def
  490. /_beepThreadProc {
  491. {
  492. /_waitToBeep winexec
  493. yield
  494. /_doBeep winexec
  495. yield
  496. nextdict /_mustBeep false put
  497. } loop
  498. } bind executeonly def
  499. /beep {
  500. _mustBeep not
  501. {
  502. _beepLock {
  503. nextdict /_mustBeep true put
  504. _beepCondition notify
  505. } monitor
  506. } if
  507. } _NXDefProc
  508. /beepPrepareToRestoreNextdict {
  509. _NXPackagesInfo /_beepContext nextdict /_beepContext get put
  510. _NXPackagesInfo /_beepCondition nextdict /_beepCondition get put
  511. _NXPackagesInfo /_beepLock nextdict /_beepLock get put
  512. } _NXDefProc
  513. /beepPrepareToReloadPackages {
  514. nextdict /_beepContext _NXPackagesInfo /_beepContext get put
  515. nextdict /_beepCondition _NXPackagesInfo /_beepCondition get put
  516. nextdict /_beepLock _NXPackagesInfo /_beepLock get put
  517. } _NXDefProc
  518. end
  519. nextdict /_beepContext get null eq
  520. {
  521. nextdict /_beepContext
  522. mark /_beepThreadProc pkget fork
  523. put
  524. _beepContext detach
  525. } if
  526. setshared
  527. currentshared true setshared
  528. windowPackage1.0 /_contextData 5 dict _NXCheckAndDef
  529. windowPackage1.0 begin
  530. /_intialContextData {
  531. //contextArraySize array
  532. dup //CDPid 0 put
  533. dup //CDKitVersion 1 put
  534. } _NXDefProc
  535. /_getOrInitContextData {
  536. /_contextData pkget
  537. exch 2 copy
  538. known not {
  539. currentshared true setshared
  540. 2 index dup maxlength
  541. exch length eq {
  542. 3 -1 roll
  543. dup maxlength 5 add
  544. dict copy
  545. dup /_contextData exch //pkput exec
  546. 3 1 roll
  547. } if
  548. 2 index 2 index
  549. //_intialContextData exec put
  550. setshared
  551. } if
  552. get
  553. } _NXDefProc
  554. /currentContextData {
  555. exch //_getOrInitContextData exec
  556. exch get
  557. } _NXDefProc
  558. /setContextData {
  559. 3 -1 roll //_getOrInitContextData exec
  560. 3 1 roll put
  561. } _NXDefProc
  562. /freeContextData {
  563. /_contextData pkget
  564. exch 2 copy
  565. known {
  566. undef
  567. }{
  568. pop pop
  569. } ifelse
  570. } _NXDefProc
  571. end
  572. setshared
  573. currentshared true setshared
  574. nextdict /_NXNullGState null _NXCheckAndDef
  575. windowPackage1.0 begin
  576. /setNullGState {
  577. _NXNullGState null eq {
  578. currentshared true setshared
  579. gsave
  580. initgraphics
  581. 0 0 0 0 Nonretained window windowdeviceround
  582. gstate
  583. grestore
  584. nextdict /_NXNullGState 3 -1 roll put
  585. setshared
  586. } if
  587. _NXNullGState setgstate
  588. } _NXDefProc
  589. /Window {
  590. {
  591. window
  592. dup
  593. currentshared true setshared //WindowDictSize dict exch setshared
  594. dup 3 -1 roll setwindowdict
  595. begin
  596. /num exch def
  597. /level 0 def
  598. /icon null def
  599. /otherWindows null def
  600. /localNum null def
  601. /rightMargin 0 def
  602. /leftMargin 0 def
  603. /topMargin 0 def
  604. /title null def
  605. /clientEventMask //defaultClientMask def
  606. /hideOnDeact false def
  607. /kitVisible false def
  608. /otherOwner null def
  609. /avoidsActivation false def
  610. //defaultClientMask num /setEventMask winexec
  611. /eventHandlers pkget num seteventprocedures
  612. } stopped {handleerror} if
  613. num
  614. end
  615. } _NXDefProc
  616. /moveWindow {
  617. movewindow
  618. } _NXDefProc
  619. /placeWindow {
  620. gsave
  621. 5 index setgstate
  622. placewindow
  623. initmatrix initclip
  624. currentgstate pop
  625. grestore
  626. } _NXDefProc
  627. /currentWindowBounds
  628. /currentwindowbounds load
  629. def
  630. /setTitle {
  631. currentwindowdict begin
  632. dup length
  633. currentshared true setshared exch string exch setshared
  634. copy
  635. /title exch def
  636. end
  637. } _NXDefProc
  638. /currentTitle {
  639. currentwindowdict /title get
  640. } _NXDefProc
  641. /setPid {
  642. /contextDataLock pkget {
  643. //CDPid exch /setContextData winexec
  644. } monitor
  645. } _NXDefProc
  646. /setKitVersion {
  647. /contextDataLock pkget {
  648. currentcontext exch //CDKitVersion exch /setContextData winexec
  649. } monitor
  650. } _NXDefProc
  651. /setOtherOwner {
  652. dup currentwindowdict /otherOwner currentcontext put
  653. /contextDataLock pkget {
  654. currentcontext exch
  655. //CDToken exch /setContextData winexec
  656. } monitor
  657. } _NXDefProc
  658. /setWSOtherOwner {
  659. currentwindowdict /otherOwner -1 put
  660. } _NXDefProc
  661. end
  662. setshared
  663. currentshared true setshared
  664. windowPackage1.0 begin
  665. /printCallStack {
  666. /userdict load /_NXCallStack known {
  667. (Call Stack:\n) print
  668. _NXCallStack _NXCallStackTop
  669. 1 sub -1 0 {
  670. 1 index exch
  671. get
  672. ( ) print =
  673. } for
  674. pop flush
  675. } if
  676. } bind executeonly def
  677. /newhandleerror {
  678. $error begin
  679. currentwriteblock mark false setwriteblock
  680. {
  681. newerror {
  682. /newerror false def
  683. (%%[ Error: ) print
  684. errorname
  685. {
  686. dup type /stringtype ne {
  687. =string cvs
  688. } if
  689. print
  690. } exec
  691. (; OffendingCommand: ) print
  692. /command load
  693. {
  694. dup type /stringtype ne {
  695. { =string cvs } stopped {
  696. pop pop (<long object>)
  697. } if
  698. } if
  699. print
  700. } exec
  701. (; Context: ) print
  702. currentcontext systemdict /= get exec
  703. (OpStack:) print
  704. ostack length 0 gt {
  705. (\n) print
  706. } if
  707. ostack
  708. aload length
  709. {
  710. ( ) print systemdict /== get exec
  711. } repeat
  712. //printCallStack exec
  713. /_NXCallStackTop 0 store
  714. (]%%\n) print
  715. flush
  716. } if
  717. } stopped pop
  718. cleartomark setwriteblock
  719. end
  720. } bind executeonly def
  721. _NXDebug {
  722. /debugmsg {
  723. currentwindowdict begin
  724. nextdict /debugging get
  725. {
  726. nextdict /errfile known not
  727. {
  728. currentshared true setshared
  729. nextdict /errfile (/tmp/pserr) (w) file put
  730. setshared
  731. } if
  732. errfile exch writestring
  733. errfile flushfile
  734. }{
  735. pop
  736. }
  737. ifelse
  738. end
  739. } _NXDefProc
  740. }if
  741. nextdict begin
  742. /_NXInstallDebugErrorHandler {
  743. $error /recordstacks true put
  744. errordict /handleerror /newhandleerror //pkget exec put
  745. userdict /_NXInstallDebugErrorHandler {} put
  746. } _NXDefProc
  747. _NXDebug {
  748. /_NXTrace {
  749. (--------- ) print
  750. print
  751. ( ---------\n) print
  752. (Context: ) print
  753. currentcontext =
  754. (OpStack:\n) print
  755. 0 1 count 3 sub {
  756. ( ) print index ==
  757. } for
  758. //printCallStack exec
  759. } bind executeonly def
  760. } if
  761. end
  762. end
  763. setshared
  764. currentshared true setshared
  765. windowPackage1.0 /_NXOldMask 0 _NXCheckAndDef
  766. windowPackage1.0 /_WSsentMouseDown false _NXCheckAndDef
  767. windowPackage1.0 /_WSMouseDown 9 array _NXCheckAndDef
  768. windowPackage1.0 /_sentMouseDown true _NXCheckAndDef
  769. windowPackage1.0 /_dragNetWin known not {
  770. 0 0 0 0 Nonretained window
  771. dup windowPackage1.0 /_dragNetWin 4 -1 roll put
  772. dup -1 -1 bitshift exch setwindowlevel
  773. dup 0 exch setowner
  774. Lmousedraggedmask Lmouseupmask or exch seteventmask
  775. } if
  776. windowPackage1.0 /_dragInitX 0.0 _NXCheckAndDef
  777. windowPackage1.0 /_draginitY 0.0 _NXCheckAndDef
  778. windowPackage1.0 /_dragWinXOffset 0.0 _NXCheckAndDef
  779. windowPackage1.0 /_dragWinYOffset 0.0 _NXCheckAndDef
  780. windowPackage1.0 /_dragWinNum 0 _NXCheckAndDef
  781. windowPackage1.0 /_dragWCEnabled true _NXCheckAndDef
  782. windowPackage1.0 /_lmupLock lock _NXCheckAndDef
  783. windowPackage1.0 /_lmdownTime 0 _NXCheckAndDef
  784. windowPackage1.0 /_lmupCount -1 _NXCheckAndDef
  785. windowPackage1.0 /_frontWin -1 _NXCheckAndDef
  786. windowPackage1.0 /_frontWinEventTime -1 -1 bitshift -1 xor _NXCheckAndDef
  787. windowPackage1.0 /_lastOpenFileEventTime 0 _NXCheckAndDef
  788. windowPackage1.0 /_hitAvoidingWindow false _NXCheckAndDef
  789. windowPackage1.0 /_pkgsDoDeferredOrdering false _NXCheckAndDef
  790. windowPackage1.0 /_pkgsDoDeferredAct false _NXCheckAndDef
  791. windowPackage1.0 /_pendingActCount 0 _NXCheckAndDef
  792. windowPackage1.0 begin
  793. /setEventMask {
  794. dup currentwindowdict
  795. /clientEventMask 3 index put exch
  796. //keyMask //Sysdefinedmask //Flagschangedmask //Rmousedownmask or or or
  797. or exch seteventmask
  798. } _NXDefProc
  799. /currentEventMask {
  800. currentwindowdict /clientEventMask get
  801. } _NXDefProc
  802. /_compareTimes {
  803. pop dup 0 eq exch
  804. /_frontWinEventTime pkget ge
  805. or
  806. } _NXDefProc
  807. /_compareTimesAndApps {
  808. /_frontWin pkget currentowner activeApp eq
  809. 1 index currentowner activeApp ne
  810. and {
  811. pop pop false
  812. }{
  813. //_compareTimes exec
  814. } ifelse
  815. } _NXDefProc
  816. /_safeTestAndOrder {
  817. dup currentwindowlevel 0 ne {
  818. Above 0 3 -1 roll
  819. /orderWinsAndPanels winexec pop pop
  820. }{
  821. mark 4 -1 roll
  822. {
  823. 3 index exch
  824. 3 index exch exec not {
  825. Below /_frontWin pkget 3 index
  826. /orderWinsAndPanels winexec
  827. pop pop pop
  828. }{
  829. stop
  830. } ifelse
  831. } stopped {
  832. cleartomark
  833. Above 0 2 index
  834. /orderWinsAndPanels winexec
  835. /_frontWin exch pkput
  836. /_frontWinEventTime exch pkput
  837. } if
  838. } ifelse
  839. } _NXDefProc
  840. /safeOrderFront {
  841. //_compareTimesAndApps 3 1 roll
  842. //_safeTestAndOrder exec
  843. } _NXDefProc
  844. /safeOrderFrontDuringOpenFile {
  845. /_lastOpenFileEventTime pkget exch //safeOrderFront exec
  846. } _NXDefProc
  847. /setLastOpenFileTime {
  848. pop /_lastOpenFileEventTime 0 //pkput exec
  849. } _NXDefProc
  850. /_sendWinMoved {
  851. //Kitdefined 4 1 roll
  852. 0 0 3 -1 roll
  853. //Winmoved 0 0
  854. 3 index currentwindowdict begin
  855. /checkAndTransmit winexec
  856. end
  857. } _NXDefProc
  858. /_frontWithClick {
  859. Above 0 2 index orderwindow
  860. dup currentwindowlevel 0 eq {
  861. /_frontWin exch //pkput exec
  862. /_frontWinEventTime exch //pkput exec
  863. }{
  864. pop pop
  865. } ifelse
  866. } _NXDefProc
  867. /_safeFrontWithClick {
  868. //_compareTimes 3 1 roll
  869. //_safeTestAndOrder exec
  870. } _NXDefProc
  871. /_pkgsDeferredOrdering {
  872. mark 3 1 roll
  873. /_pkgsDoDeferredOrdering pkget {
  874. {
  875. exch 1 index
  876. //_safeFrontWithClick exec
  877. /_pkgsDoDeferredAct pkget {
  878. /_pendingActCount pkget exch
  879. /pseudoActivateWindow winexec
  880. } if
  881. } stopped
  882. } if
  883. cleartomark
  884. /_pkgsDoDeferredOrdering false pkput
  885. /_pkgsDoDeferredAct false pkput
  886. } _NXDefProc
  887. /_doKitDeferredOrdering {
  888. mark 7 1 roll
  889. 3 -1 roll
  890. /_lmupCount pkget gt {
  891. /_pkgsDoDeferredOrdering false pkput
  892. /_pkgsDoDeferredAct false pkput
  893. } if
  894. {
  895. 5 -1 roll {
  896. exch 1 index
  897. //_safeFrontWithClick exec
  898. }{
  899. exch pop
  900. } ifelse
  901. 3 -1 roll {
  902. /pseudoActivateWindow winexec
  903. } if
  904. } stopped pop
  905. cleartomark
  906. } _NXDefProc
  907. /kitDeferredOrdering {
  908. //_lmupLock {
  909. 2 index /_lmupCount pkget gt
  910. 7 index or
  911. 8 -1 roll
  912. 7 -1 roll
  913. 5 index /_lmupCount pkget gt
  914. or or
  915. 7 -1 roll and
  916. 6 2 roll
  917. //_doKitDeferredOrdering exec
  918. } monitor
  919. } _NXDefProc
  920. /blockWindowOrdering {
  921. //_lmupLock {
  922. /_lmupCount pkget gt {
  923. /_pkgsDoDeferredOrdering false pkput
  924. /_pkgsDoDeferredAct false pkput
  925. true
  926. }{
  927. false
  928. } ifelse
  929. } monitor
  930. } _NXDefProc
  931. /_prepareToDrag {
  932. //Above 0 //_dragNetWin orderwindow
  933. false setflushexposures
  934. //Lmousedragged //Firstwindow sethowpost
  935. //Lmouseup //Firstwindow sethowpost
  936. dup /_dragWinNum exch //pkput exec
  937. currentwindowbounds pop pop
  938. /_dragInitY exch //pkput exec
  939. /_dragInitX exch //pkput exec
  940. /_dragWinYOffset exch //pkput exec
  941. /_dragWinXOffset exch //pkput exec
  942. /_dragWCEnabled 0 currentwaitcursorenabled //pkput exec
  943. false 0 setwaitcursorenabled
  944. } _NXDefProc
  945. /doDragWindow {
  946. //_lmupLock {
  947. exch /_lmupCount pkget gt {
  948. //_prepareToDrag exec
  949. }{
  950. dup currentwindowbounds pop pop
  951. 3 -1 roll //_sendWinMoved exec
  952. pop pop
  953. } ifelse
  954. } monitor
  955. } _NXDefProc
  956. /_reapContext {
  957. mark exch
  958. dup //CDToken /currentContextData winexec
  959. exch /freeContextData winexec
  960. dup null ne {
  961. {
  962. currentwindowdict
  963. /otherOwner null put
  964. } stopped
  965. } if
  966. cleartomark
  967. } _NXDefProc
  968. /_doPostEvent {
  969. nextdict /_journalRecording get {
  970. 7 -1 roll Journalflagmask or 7 1 roll
  971. } if
  972. stopped {
  973. 10 {pop} repeat
  974. false
  975. }{
  976. not {
  977. (event not posted\n) print
  978. (Frog) 1 playsound
  979. } if
  980. true
  981. } ifelse
  982. }
  983. _NXDebug {
  984. dup length 1 add array cvx
  985. dup 1
  986. 4 -1 roll
  987. putinterval
  988. dup 0 /_NXInstallDebugErrorHandler cvx put
  989. } if
  990. _NXDefProc
  991. true {
  992. /postByContext {
  993. 11 1 roll
  994. dup 0 eq {
  995. 10 {pop} repeat
  996. {
  997. /beep winexec
  998. } if
  999. }{
  1000. dup 12 1 roll
  1001. /posteventbycontext cvx
  1002. //_doPostEvent exec {
  1003. pop pop
  1004. }{
  1005. {
  1006. /beep winexec
  1007. } if
  1008. //_reapContext exec
  1009. } ifelse
  1010. } ifelse
  1011. } _NXDefProc
  1012. }{
  1013. /postByContext {
  1014. 11 1 roll
  1015. dup 0 eq {
  1016. 10 {pop} repeat
  1017. {
  1018. /beep winexec
  1019. } if
  1020. }{
  1021. dup 12 1 roll
  1022. 5 -1 roll pop 4 1 roll
  1023. Bypscontext
  1024. //_doPostEvent exec not {
  1025. {
  1026. /beep winexec
  1027. } if
  1028. //_reapContext exec
  1029. }{
  1030. pop pop
  1031. } ifelse
  1032. } ifelse
  1033. } _NXDefProc
  1034. } ifelse
  1035. /checkAndTransmit {
  1036. 8 index 1 exch bitshift clientEventMask and 0 ne
  1037. {
  1038. /transmitEvent winexec
  1039. }{
  1040. 9 {pop} repeat
  1041. }
  1042. ifelse
  1043. } _NXDefProc
  1044. /_postToNilWindow {
  1045. 8 index
  1046. 8 index
  1047. 6 index currentwindowbounds pop pop
  1048. 3 -1 roll add
  1049. 3 1 roll add
  1050. 11 -1 roll pop 10 1 roll
  1051. 9 -1 roll pop 8 1 roll
  1052. 5 -1 roll pop 0 5 1 roll
  1053. activeApp exch /postByContext winexec
  1054. } _NXDefProc
  1055. /_handleCommand {
  1056. mark 10 1 roll
  1057. 1 index -16 bitshift
  1058. 2 index 65535 and
  1059. dup 46 eq
  1060. 2 index 0 eq and
  1061. 1 index 173 eq
  1062. 2 index 175 eq or
  1063. 4 -1 roll 1 eq and
  1064. 7 index //Numericpadmask and 0 ne and
  1065. or {
  1066. 3 index 65535 and 0 eq {
  1067. dup 173 eq {
  1068. true 0 /getWindows winexec
  1069. mark exch {
  1070. mark exch
  1071. dup currentwindowlevel 0 eq {
  1072. dup currentwindowdict
  1073. dup null ne {
  1074. /icon get 1 ne {
  1075. Above exch 0 exch orderwindow
  1076. cleartomark
  1077. exit
  1078. } if
  1079. } if
  1080. } if
  1081. cleartomark
  1082. } /revForall winexec
  1083. cleartomark
  1084. /returnWindows winexec
  1085. }{
  1086. dup 175 eq {
  1087. true 0 /getWindows winexec
  1088. mark exch {
  1089. dup currentwindowlevel 0 eq {
  1090. dup currentwindowdict
  1091. dup null ne {
  1092. /icon get 1 ne {
  1093. Below exch 0 exch
  1094. systemdict /orderwindow get exec
  1095. exit
  1096. } if
  1097. } if
  1098. } if
  1099. } forall
  1100. cleartomark
  1101. /returnWindows winexec
  1102. }{
  1103. pop
  1104. activeApp true /postByContext winexec
  1105. activeApp //CDPid /currentContextData winexec
  1106. dup 0 ne
  1107. {
  1108. 2 unixsignal
  1109. }{
  1110. pop
  1111. } ifelse
  1112. } ifelse
  1113. } ifelse
  1114. }{
  1115. pop
  1116. } ifelse
  1117. }{
  1118. pop
  1119. activeApp true /postByContext winexec
  1120. } ifelse
  1121. cleartomark
  1122. } _NXDefProc
  1123. /_ptInRect {
  1124. false mark 8 2 roll
  1125. 6 -1 roll 5 -1 roll sub
  1126. 5 -2 roll sub
  1127. dup 0 ge {
  1128. exch dup 0 ge {
  1129. 4 -1 roll lt {
  1130. gt {
  1131. exch pop true exch
  1132. } if
  1133. } if
  1134. } if
  1135. } if
  1136. cleartomark
  1137. } _NXDefProc
  1138. /_testTitleBar {
  1139. currentwindowbounds 4 2 roll pop pop
  1140. topMargin sub 3 -1 roll exch sub 1 sub exch
  1141. 1 index 0 ge {
  1142. topMargin //wbutSize sub 2 div
  1143. 3 index leftMargin lt {
  1144. exch pop
  1145. leftMargin //wbutSize sub
  1146. exch
  1147. //wbutSize //wbutSize
  1148. //_ptInRect exec
  1149. }{
  1150. 1 index rightMargin sub 4 index le {
  1151. exch rightMargin sub
  1152. exch
  1153. //wbutSize //wbutSize
  1154. //_ptInRect exec
  1155. }{
  1156. pop pop pop pop false
  1157. } ifelse
  1158. } ifelse
  1159. true
  1160. }{
  1161. pop pop pop false false
  1162. } ifelse
  1163. } _NXDefProc
  1164. /transmitEvent {
  1165. 3 index 0 ne {
  1166. 3 index currentwindowdict
  1167. /localNum get 3 //stackSwap exec
  1168. currentowner true
  1169. /postByContext winexec
  1170. }{
  1171. 9 {pop} repeat
  1172. /beep winexec
  1173. (transmitEvent can't post to a nil window\n) print
  1174. } ifelse
  1175. } _NXDefProc
  1176. /_lmdownInTitle {
  1177. dup 3 index 1 gt or {
  1178. not icon 1 eq and 2 index 2 eq and {
  1179. 3 index currentowner activeApp ne {
  1180. num currentowner //CDKitVersion
  1181. /currentContextData winexec
  1182. 2 ge {
  1183. num /activateByWindow winexec
  1184. }{
  1185. num currentowner /activateContext winexec
  1186. } ifelse
  1187. } if
  1188. } if
  1189. /transmitEvent winexec
  1190. }{
  1191. pop
  1192. 4 index //buckyBitMask and //Commandmask eq {
  1193. num currentwindowlevel 0 eq {
  1194. Below 0 num
  1195. systemdict /orderwindow get exec
  1196. } if
  1197. 9 {pop} repeat
  1198. /_sentMouseDown false //pkput exec
  1199. }{
  1200. 5 index num //_frontWithClick exec
  1201. 7 index 7 index 6 index
  1202. 12 3 roll
  1203. 4 index //buckyBitMask and
  1204. //Alternatemask eq
  1205. icon 1 eq or {
  1206. 9 {pop} repeat
  1207. /_sentMouseDown false //pkput exec
  1208. }{
  1209. 3 index currentowner activeApp ne {
  1210. avoidsActivation {
  1211. /_hitAvoidingWindow true //pkput exec
  1212. }{
  1213. num /activateByWindow winexec
  1214. } ifelse
  1215. } if
  1216. /transmitEvent winexec
  1217. } ifelse
  1218. Journalflagmask and 0 eq {
  1219. num //_prepareToDrag exec
  1220. }{
  1221. pop pop
  1222. } ifelse
  1223. } ifelse
  1224. } ifelse
  1225. } _NXDefProc
  1226. /_lmdownInBody {
  1227. pop
  1228. num currentowner //CDKitVersion
  1229. /currentContextData winexec
  1230. 2 ge {
  1231. 1 index 1 eq {
  1232. /_pkgsDoDeferredOrdering true pkput
  1233. num currentowner activeApp ne {
  1234. avoidsActivation not {
  1235. /_pkgsDoDeferredAct true pkput
  1236. } if
  1237. num currentowner
  1238. /sendDeferredAct winexec
  1239. /_pendingActCount exch pkput
  1240. } if
  1241. } if
  1242. }{
  1243. 5 index num //_frontWithClick exec
  1244. num currentowner activeApp ne {
  1245. num /activateByWindow winexec
  1246. } if
  1247. } ifelse
  1248. /transmitEvent winexec
  1249. } _NXDefProc
  1250. /_lmdownWithHelp {
  1251. pop pop
  1252. 1 index 1 eq
  1253. num currentowner activeApp ne and {
  1254. num currentowner /activateContext winexec
  1255. } if
  1256. /transmitEvent winexec
  1257. } _NXDefProc
  1258. /lmdownEvProc {
  1259. /_lmdownTime 6 index //pkput exec
  1260. /_sentMouseDown true //pkput exec
  1261. /_hitAvoidingWindow false //pkput exec
  1262. /_pkgsDoDeferredOrdering false //pkput exec
  1263. /_pkgsDoDeferredAct false //pkput exec
  1264. 3 index currentwindowdict begin
  1265. {
  1266. 7 index 7 index 5 index //_testTitleBar exec
  1267. 6 index //buckyBitMask and
  1268. dup //Helpmask eq
  1269. exch //Controlmask //Alternatemask or eq or {
  1270. //_lmdownWithHelp exec
  1271. }{
  1272. {
  1273. //_lmdownInTitle exec
  1274. }{
  1275. //_lmdownInBody exec
  1276. } ifelse
  1277. } ifelse
  1278. } stopped {
  1279. end handleerror
  1280. }{
  1281. end
  1282. } ifelse
  1283. } _NXDefProc
  1284. /_transmitLmup {
  1285. 1 index 4 index 11 2 roll
  1286. /transmitEvent winexec
  1287. /_hitAvoidingWindow pkget
  1288. 1 index currentowner activeApp ne
  1289. 4 -1 roll 1 eq and and {
  1290. currentowner /activateContext winexec
  1291. }{
  1292. pop
  1293. } ifelse
  1294. } _NXDefProc
  1295. /lmupEvProc {
  1296. //_lmupLock {
  1297. /_lmupCount 3 index //pkput exec
  1298. /_dragWinNum pkget 0 eq {
  1299. /_lmdownTime //pkget exec
  1300. 4 index //_pkgsDeferredOrdering exec
  1301. /_sentMouseDown pkget {
  1302. //_transmitLmup exec
  1303. }{
  1304. 9 {pop} repeat
  1305. } ifelse
  1306. }{
  1307. /lmupWinDragEvProc winexec
  1308. } ifelse
  1309. } monitor
  1310. } _NXDefProc
  1311. /_postRightEvent {
  1312. 4 index currentowner activeApp eq
  1313. {
  1314. pop /transmitEvent winexec
  1315. }{
  1316. //_postToNilWindow exec
  1317. } ifelse
  1318. } _NXDefProc
  1319. /rmdownEvProc {
  1320. 3 index currenteventmask
  1321. /_NXOldMask 1 index //pkput exec
  1322. //MenuEvent or 4 index seteventmask
  1323. true //_postRightEvent exec
  1324. } _NXDefProc
  1325. /rmupEvProc {
  1326. /_NXOldMask pkget 4 index seteventmask
  1327. false //_postRightEvent exec
  1328. } _NXDefProc
  1329. /rmdragEvProc {
  1330. false //_postRightEvent exec
  1331. } _NXDefProc
  1332. /mEnterEvProc {
  1333. dup -1 eq {
  1334. //Cursorrect 8 //stackSwap exec pop
  1335. Mouseentered 4 //stackSwap exec pop
  1336. } if
  1337. /transmitEvent winexec
  1338. } _NXDefProc
  1339. /mExitEvProc {
  1340. dup -1 eq
  1341. {
  1342. //Cursorrect 8 //stackSwap exec pop
  1343. Mouseexited 4 //stackSwap exec pop
  1344. } if
  1345. /transmitEvent winexec
  1346. } _NXDefProc
  1347. /keyDownEvProc {
  1348. 4 index //Commandmask and 0 ne
  1349. {
  1350. 2 index 65535 and 0 eq
  1351. 10 1 roll
  1352. /_handleCommand winexec
  1353. activeApp 0 eq
  1354. and
  1355. {
  1356. /beep winexec
  1357. } if
  1358. }{
  1359. activeApp 0 eq {
  1360. /beep winexec
  1361. }{
  1362. activeApp true /postByContext winexec
  1363. } ifelse
  1364. } ifelse
  1365. } _NXDefProc
  1366. /flagsChEvProc {
  1367. nextdict /currentEventFlags 6 index put
  1368. nextdict /_NXCurrentEventFlags 6 index put
  1369. activeApp false /postByContext winexec
  1370. } _NXDefProc
  1371. /keyUpEvProc
  1372. /flagsChEvProc load _NXDefProc
  1373. /sysDefEvProc {
  1374. 2 index 1 eq {
  1375. 4 -1 roll pop 0 4 1 roll
  1376. //Broadcast /postevent cvx //_doPostEvent exec not {
  1377. handleerror
  1378. } if
  1379. }{
  1380. 2 index 0 eq {
  1381. 1 index activeApp eq {
  1382. appLock
  1383. {
  1384. nextdict /activeApp 0 put
  1385. /setArrowCursor winexec
  1386. } monitor
  1387. } if
  1388. 5 index 2 index /activateNextApp winexec
  1389. 1 index //_reapContext exec
  1390. } if
  1391. 9 {pop} repeat
  1392. } ifelse
  1393. } _NXDefProc
  1394. /lmdownWSEvProc {
  1395. 3 index currentwindowdict /otherOwner get
  1396. dup null eq {
  1397. activeApp ne 2 index 2 eq and {
  1398. /deactivateCurrContext winexec
  1399. 4 index //buckyBitMask and
  1400. //Commandmask eq {
  1401. 0 /hideOtherApps winexec
  1402. } if
  1403. } if
  1404. /_WSsentMouseDown true //pkput exec
  1405. /transmitEvent winexec
  1406. }{
  1407. dup -1 eq {
  1408. pop
  1409. /_WSsentMouseDown true //pkput exec
  1410. /transmitEvent winexec
  1411. }{
  1412. 2 index 1 eq {
  1413. pop Above 0 5 index orderwindow
  1414. /_WSMouseDown pkget astore
  1415. }{
  1416. 2 index 2 eq {
  1417. //Kitdefined 0 0 0 0 0
  1418. //AppUnhide 0 0
  1419. 9 index
  1420. /posteventbycontext cvx
  1421. //_doPostEvent exec {
  1422. 5 index //buckyBitMask and
  1423. //Commandmask eq {
  1424. /hideOtherApps winexec
  1425. }{
  1426. /activateContext winexec
  1427. } ifelse
  1428. 9 {pop} repeat
  1429. }{
  1430. //_reapContext exec
  1431. /_WSsentMouseDown true //pkput exec
  1432. /transmitEvent winexec
  1433. } ifelse
  1434. }{
  1435. 10 {pop} repeat
  1436. } ifelse
  1437. } ifelse
  1438. } ifelse
  1439. } ifelse
  1440. } _NXDefProc
  1441. /lmdragWSEvProc {
  1442. 3 index currentwindowdict /otherOwner get
  1443. null ne {
  1444. /_WSsentMouseDown pkget not {
  1445. /_WSMouseDown pkget
  1446. dup aload pop
  1447. 15 index 6 index sub 18 gt
  1448. 18 index 9 index sub abs 5 gt
  1449. 18 index 9 index sub abs 5 gt
  1450. or or {
  1451. /transmitEvent winexec pop
  1452. /_WSsentMouseDown true //pkput exec
  1453. /transmitEvent winexec
  1454. }{
  1455. 19 {pop} repeat
  1456. } ifelse
  1457. }{
  1458. /transmitEvent winexec
  1459. } ifelse
  1460. }{
  1461. /transmitEvent winexec
  1462. } ifelse
  1463. } _NXDefProc
  1464. /lmupWSEvProc {
  1465. /_WSsentMouseDown pkget
  1466. {
  1467. /transmitEvent winexec
  1468. }{
  1469. 9 {pop} repeat
  1470. } ifelse
  1471. /_WSsentMouseDown false //pkput exec
  1472. } _NXDefProc
  1473. /gridWindow {
  1474. dup currentwindowdict /icon get 1 eq
  1475. nextdict /_NXSnapIconsToGrid get
  1476. 4 -1 roll //Alternatemask and 0 eq
  1477. and and {
  1478. 0 currentwindowbounds
  1479. 4 index currentwindowbounds pop pop
  1480. 2 {
  1481. 64 div round 64 mul exch
  1482. } repeat
  1483. 2 {
  1484. dup 3 index 6 index add 1 sub gt {
  1485. 64 sub
  1486. } if
  1487. dup 5 index lt {
  1488. 64 add
  1489. } if
  1490. 6 1 roll
  1491. } repeat
  1492. pop pop pop pop
  1493. 3 -1 roll movewindow
  1494. }{
  1495. pop
  1496. } ifelse
  1497. } _NXDefProc
  1498. /lmdragWinDragEvProc {
  1499. 6 {pop} repeat
  1500. /_dragWinYOffset pkget sub exch
  1501. /_dragWinXOffset pkget sub exch
  1502. /_dragWinNum pkget
  1503. nextdict /_journalRecording get {
  1504. 3 1 roll
  1505. 2 index currentwindowbounds pop pop
  1506. 2 index
  1507. exch
  1508. sub
  1509. exch
  1510. 3 index
  1511. exch
  1512. sub
  1513. exch
  1514. Journalevent 3 1 roll 0 0 7 index //Windragged 0 0
  1515. /transmitEvent winexec
  1516. 3 -1 roll
  1517. } if
  1518. dup currentwindowdict /otherWindows get
  1519. dup null eq {
  1520. pop movewindow pop
  1521. }{
  1522. 1 index currentwindowbounds pop pop
  1523. 4 index exch sub exch
  1524. 5 index exch sub exch
  1525. 6 3 roll movewindow
  1526. 3 -1 roll
  1527. dup length 1 sub 1 exch getinterval {
  1528. mark exch {
  1529. dup currentwindowbounds pop pop
  1530. 4 index add exch
  1531. 5 index add exch
  1532. 3 -1 roll movewindow
  1533. } stopped pop
  1534. cleartomark
  1535. } forall pop pop pop
  1536. } ifelse
  1537. } _NXDefProc
  1538. /lmupWinDragEvProc {
  1539. 9 copy
  1540. //lmdragWinDragEvProc exec
  1541. //Out 0 //_dragNetWin orderwindow
  1542. true setflushexposures
  1543. //Lmousedragged //Lastleft sethowpost
  1544. //Lmouseup //Lastleft sethowpost
  1545. 4 index 10 1 roll
  1546. /_sentMouseDown pkget {
  1547. /_dragWinNum pkget 3 //stackSwap exec pop
  1548. /_dragWinYOffset pkget 6 //stackSwap exec pop
  1549. /_dragWinXOffset pkget 7 //stackSwap exec pop
  1550. //_transmitLmup exec
  1551. }{
  1552. 9 {pop} repeat
  1553. } ifelse
  1554. /_dragWinNum pkget exch 1 index
  1555. //gridWindow exec
  1556. dup currentwindowbounds pop pop 2 copy
  1557. /_dragInitY pkget ne exch
  1558. /_dragInitX pkget ne exch
  1559. or {
  1560. 3 -1 roll //_sendWinMoved exec
  1561. }{
  1562. pop pop pop
  1563. } ifelse
  1564. /_dragWCEnabled //pkget exec 0 setwaitcursorenabled
  1565. /_dragWinNum 0 //pkput exec
  1566. } _NXDefProc
  1567. /eventsPrepareToRestoreNextdict {
  1568. /_dragNetWin pkget termwindow
  1569. } _NXDefProc
  1570. windowPackage1.0 /eventHandlers [
  1571. /transmitEvent load
  1572. /lmdownEvProc load
  1573. /lmupEvProc load
  1574. /rmdownEvProc load
  1575. /rmupEvProc load
  1576. /transmitEvent load
  1577. /transmitEvent load
  1578. /rmdragEvProc load
  1579. /mEnterEvProc load
  1580. /mExitEvProc load
  1581. /keyDownEvProc load
  1582. /keyUpEvProc load
  1583. /flagsChEvProc load
  1584. /transmitEvent load
  1585. /sysDefEvProc load
  1586. /transmitEvent load
  1587. ] _NXCheckAndDef
  1588. windowPackage1.0 /deskWinHandler [
  1589. null
  1590. null
  1591. null
  1592. /rmdownEvProc load
  1593. /rmupEvProc load
  1594. null
  1595. null
  1596. /rmdragEvProc load
  1597. null
  1598. null
  1599. null
  1600. null
  1601. null
  1602. null
  1603. /sysDefEvProc load
  1604. null
  1605. ] _NXCheckAndDef
  1606. windowPackage1.0 /workspaceHandler [
  1607. null
  1608. /lmdownWSEvProc load
  1609. /lmupWSEvProc load
  1610. /rmdownEvProc load
  1611. /rmupEvProc load
  1612. null
  1613. /lmdragWSEvProc load
  1614. /rmdragEvProc load
  1615. null
  1616. null
  1617. /keyDownEvProc load
  1618. /keyUpEvProc load
  1619. /flagsChEvProc load
  1620. null
  1621. /sysDefEvProc load
  1622. null
  1623. ] _NXCheckAndDef
  1624. windowPackage1.0 /_dragWindowHandler [
  1625. null
  1626. null
  1627. /lmupWinDragEvProc load
  1628. null
  1629. null
  1630. null
  1631. /lmdragWinDragEvProc load
  1632. null
  1633. null
  1634. null
  1635. null
  1636. null
  1637. null
  1638. null
  1639. /sysDefEvProc load
  1640. null
  1641. ] _NXCheckAndDef
  1642. windowPackage1.0 /specialTileHandler [
  1643. null
  1644. /transmitEvent load
  1645. /transmitEvent load
  1646. /rmdownEvProc load
  1647. /rmupEvProc load
  1648. null
  1649. /transmitEvent load
  1650. /rmdragEvProc load
  1651. null
  1652. null
  1653. /keyDownEvProc load
  1654. /keyUpEvProc load
  1655. /flagsChEvProc load
  1656. null
  1657. /sysDefEvProc load
  1658. null
  1659. ] _NXCheckAndDef
  1660. //Rmousedownmask //Sysdefinedmask or deskWin seteventmask
  1661. deskWinHandler deskWin seteventprocedures
  1662. _dragWindowHandler _dragNetWin seteventprocedures
  1663. end
  1664. setshared
  1665. currentshared true setshared
  1666. nextdict /_windowCoverLock lock _NXCheckAndDef
  1667. nextdict /_coverWin 0 _NXCheckAndDef
  1668. nextdict /_edgeWindows 0 _NXCheckAndDef
  1669. windowPackage1.0 begin
  1670. /ensureEdgeWindows {
  1671. _windowCoverLock
  1672. {
  1673. _edgeWindows 0 eq
  1674. {
  1675. currentshared true setshared
  1676. gsave
  1677. 0.1 setgray
  1678. 1 1 4 {
  1679. pop
  1680. 0 0 0 0 Nonretained window
  1681. dup currentcontext exch setowner
  1682. dup 25 exch setwindowlevel
  1683. dup windowdeviceround
  1684. setexposurecolor
  1685. } for
  1686. 4 array astore
  1687. grestore
  1688. exch setshared
  1689. }{
  1690. _edgeWindows
  1691. dup {currentcontext exch setowner} forall
  1692. nextdict /_edgeWindows 0 put
  1693. } ifelse
  1694. /userdict load /_NXedgeWindows 3 -1 roll put
  1695. }
  1696. monitor
  1697. } _NXDefProc
  1698. /placeEdgeWindows {
  1699. aload pop /userdict load /_NXedgeWindows get {placewindow} forall
  1700. } _NXDefProc
  1701. /showEdgeWindows {
  1702. /userdict load /_NXedgeWindows get {Above 0 3 -1 roll orderwindow} forall
  1703. } _NXDefProc
  1704. /hideEdgeWindows {
  1705. /userdict load /_NXedgeWindows get {Out 0 3 -1 roll orderwindow} forall
  1706. _windowCoverLock
  1707. {
  1708. /userdict load /_NXedgeWindows get
  1709. _edgeWindows 0 eq
  1710. {
  1711. dup {0 exch setowner} forall
  1712. nextdict /_edgeWindows 3 -1 roll put
  1713. }{
  1714. {termwindow} forall
  1715. } ifelse
  1716. /userdict load /_NXedgeWindows 0 put
  1717. }
  1718. monitor
  1719. } _NXDefProc
  1720. /_checkOutCoverWin {
  1721. _windowCoverLock
  1722. {
  1723. _coverWin 0 eq
  1724. {
  1725. currentshared true setshared
  1726. 0 0 0 0 Nonretained window
  1727. dup currentcontext exch setowner
  1728. dup false exch setautofill
  1729. exch setshared
  1730. }{
  1731. _coverWin
  1732. dup currentcontext exch setowner
  1733. nextdict /_coverWin 0 put
  1734. } ifelse
  1735. /userdict load /_NXcoverWindow 3 -1 roll put
  1736. }
  1737. monitor
  1738. } _NXDefProc
  1739. /_checkInCoverWin {
  1740. _windowCoverLock
  1741. {
  1742. /userdict load /_NXcoverWindow get
  1743. _coverWin 0 eq
  1744. {
  1745. dup 0 exch setowner
  1746. nextdict /_coverWin 3 -1 roll put
  1747. }{
  1748. termwindow
  1749. } ifelse
  1750. /userdict load /_NXcoverWindow 0 put
  1751. }
  1752. monitor
  1753. } _NXDefProc
  1754. /coverWindow {
  1755. mark exch
  1756. //_checkOutCoverWin exec
  1757. /userdict load /_NXcoverWindow get
  1758. {
  1759. 1 index currentwindowlevel
  1760. 1 index setwindowlevel
  1761. 1 index currentwindowbounds
  1762. 4 index placewindow
  1763. Above 2 index 3 -1 roll orderwindow
  1764. Out 0 3 -1 roll orderwindow
  1765. } stopped {
  1766. //_checkInCoverWin exec
  1767. }
  1768. cleartomark
  1769. } _NXDefProc
  1770. /uncoverWindow {
  1771. /userdict load /_NXcoverWindow get
  1772. dup 0 ne {
  1773. appLock {
  1774. 1 index currentwindowdict
  1775. dup /hideOnDeact get not
  1776. exch /kitVisible get
  1777. activeApp currentcontext eq
  1778. and or {
  1779. {
  1780. Above 1 index 4 -1 roll
  1781. orderwindow
  1782. } stopped {
  1783. pop pop pop
  1784. } if
  1785. }{
  1786. exch pop
  1787. } ifelse
  1788. } monitor
  1789. Out 0 3 -1 roll orderwindow
  1790. //_checkInCoverWin exec
  1791. }{
  1792. pop pop
  1793. } ifelse
  1794. } _NXDefProc
  1795. /resizePrepareToRestoreNextdict {
  1796. _NXPackagesInfo /_windowCoverLock nextdict /_windowCoverLock get put
  1797. _NXPackagesInfo /_coverWin nextdict /_coverWin get put
  1798. _NXPackagesInfo /_edgeWindows nextdict /_edgeWindows get put
  1799. } _NXDefProc
  1800. /resizePrepareToReloadPackages {
  1801. nextdict /_windowCoverLock _NXPackagesInfo /_windowCoverLock get put
  1802. nextdict /_coverWin _NXPackagesInfo /_coverWin get put
  1803. nextdict /_edgeWindows _NXPackagesInfo /_edgeWindows get put
  1804. } _NXDefProc
  1805. end
  1806. setshared
  1807. currentshared true setshared
  1808. windowPackage1.0 begin
  1809. /setCursor {
  1810. appLock
  1811. {
  1812. {
  1813. /lastCompletedActivation pkget eq {
  1814. setcursor
  1815. }{
  1816. pop pop pop pop
  1817. } ifelse
  1818. } stopped
  1819. {handleerror} if
  1820. } monitor
  1821. } _NXSimpleDefProc
  1822. /setArrowCursor {
  1823. gsave
  1824. {
  1825. sharedCursors windowdeviceround
  1826. 0 48 1 -1 setcursor
  1827. } stopped
  1828. {handleerror} if
  1829. grestore
  1830. } _NXSimpleDefProc
  1831. end
  1832. setshared
  1833. currentshared true setshared
  1834. windowPackage1.0 /_winList null _NXCheckAndDef
  1835. nextdict /_winListLock lock _NXCheckAndDef
  1836. windowPackage1.0 begin
  1837. /setWindowLevel /setwindowlevel load def
  1838. /localScreenList {
  1839. currentcontext screenlist
  1840. 0 1 2 index length 1 sub {
  1841. 1 index exch
  1842. 2 copy get
  1843. currentwindowdict dup null ne {
  1844. /localNum get
  1845. }{
  1846. pop -1
  1847. } ifelse
  1848. put
  1849. } for
  1850. } _NXDefProc
  1851. /getWindows {
  1852. //_winListLock {
  1853. dup 2 index {
  1854. countscreenlist
  1855. }{
  1856. countwindowlist
  1857. } ifelse
  1858. 5 add
  1859. /_winList //pkget exec
  1860. /_winList null //pkput exec
  1861. } monitor
  1862. dup null eq {
  1863. true
  1864. }{
  1865. dup length 2 index lt
  1866. } ifelse
  1867. {
  1868. pop currentshared true setshared
  1869. exch array
  1870. exch setshared
  1871. }{
  1872. exch pop
  1873. } ifelse
  1874. dup 4 2 roll exch {
  1875. screenlist
  1876. }{
  1877. windowlist
  1878. } ifelse
  1879. } _NXDefProc
  1880. /returnWindows {
  1881. //_winListLock {
  1882. /_winList pkget
  1883. dup null eq {
  1884. pop
  1885. }{
  1886. 1 index length
  1887. 1 index length
  1888. lt {
  1889. exch
  1890. } if pop
  1891. } ifelse
  1892. /_winList exch //pkput exec
  1893. } monitor
  1894. } _NXDefProc
  1895. end
  1896. setshared
  1897. currentshared true setshared
  1898. 0 =string framebuffer pop
  1899. 8 2 roll 6 {pop} repeat exch
  1900. 64 idiv 1 sub 64 mul
  1901. windowPackage1.0 /_zeroScreenLimit
  1902. 2 index _NXCheckAndDef
  1903. 64 idiv
  1904. exch 64 idiv mul dup
  1905. string windowPackage1.0 exch
  1906. /_miniMap exch _NXCheckAndDef
  1907. string windowPackage1.0 exch
  1908. /_zeroMiniMap exch _NXCheckAndDef
  1909. windowPackage1.0 begin
  1910. /_isIcon {
  1911. mark exch
  1912. {
  1913. currentwindowdict /icon get 1 eq
  1914. exch pop
  1915. } stopped {
  1916. cleartomark false
  1917. } if
  1918. } _NXDefProc
  1919. /calcIconPosition {
  1920. /contextDataLock pkget {
  1921. //_miniMap 0 //_zeroMiniMap putinterval
  1922. false 0 /getWindows winexec {
  1923. dup //_isIcon exec {
  1924. dup currentwindowbounds pop pop
  1925. 1 index -32 ge
  1926. 2 index 64 add //_zeroScreenLimit le and {
  1927. 2 {
  1928. 64 div round 64 mul exch
  1929. } repeat
  1930. 2 {
  1931. 1 index 64 div
  1932. } repeat
  1933. //_zeroScreenLimit 64 idiv
  1934. mul add cvi
  1935. dup //_miniMap length lt
  1936. 1 index 0 ge and {
  1937. //_miniMap exch 1 put
  1938. }{
  1939. pop
  1940. } ifelse
  1941. pop pop pop
  1942. }{
  1943. pop pop pop
  1944. } ifelse
  1945. }{
  1946. pop
  1947. } ifelse
  1948. } forall
  1949. /returnWindows winexec
  1950. 0 0 1 //_miniMap length 1 sub {
  1951. //_miniMap exch get 0 eq {
  1952. exit
  1953. }{
  1954. 1 add
  1955. } ifelse
  1956. } for
  1957. } monitor
  1958. } _NXDefProc
  1959. end
  1960. setshared
  1961.